from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import viewsets

from MirrorCore.models.User import User
from MirrorCore.permissions.permisssion import IsStaffOrReadOnly
from MirrorCore.serializers.UserSerializer import UserSerializer


class UserViewSet(viewsets.ModelViewSet):
    filter_backends = [DjangoFilterBackend]
    filterset_fields = ["username"]
    permission_classes = [IsStaffOrReadOnly]
    queryset = User.objects.all()
    serializer_class = UserSerializer


